@echo off
echo 正在修复 Android SDK 问题...

echo.
echo 1. 检查环境变量...
echo ANDROID_HOME: %ANDROID_HOME%
echo ANDROID_SDK_ROOT: %ANDROID_SDK_ROOT%

echo.
echo 2. 设置环境变量...
setx ANDROID_HOME "C:\Users\Administrator\AppData\Local\Android\Sdk" /M
setx ANDROID_SDK_ROOT "C:\Users\Administrator\AppData\Local\Android\Sdk" /M

echo.
echo 3. 检查 SDK 路径...
if exist "C:\Users\Administrator\AppData\Local\Android\Sdk" (
    echo ✓ SDK 路径存在
) else (
    echo ✗ SDK 路径不存在
)

echo.
echo 4. 检查 SDK 组件...
if exist "C:\Users\Administrator\AppData\Local\Android\Sdk\platforms\android-33" (
    echo ✓ Android SDK 33 已安装
) else (
    echo ✗ Android SDK 33 未安装
)

if exist "C:\Users\Administrator\AppData\Local\Android\Sdk\build-tools\33.0.3" (
    echo ✓ Build Tools 33.0.3 已安装
) else (
    echo ✗ Build Tools 33.0.3 未安装
)

echo.
echo 5. 清理项目...
call gradlew clean

echo.
echo 修复完成！请重启 Android Studio。
pause 